package io.kimmking.rpcfx.demo.provider;

import io.kimmking.rpcfx.api.RpcfxProvider;
import io.kimmking.rpcfx.context.RpcfxContext;
import io.kimmking.rpcfx.demo.api.Order;
import io.kimmking.rpcfx.demo.api.OrderService;
import org.springframework.stereotype.Component;

import java.util.HashMap;

@RpcfxProvider(serverName = "io.kimmking.rpcfx.demo.api.OrderService",tag = "config",version = "1.0.0")
@Component
public class OrderServiceImpl implements OrderService {

    @Override
    public Order findOrderById(int id) {
        HashMap<String, String> ctx = RpcfxContext.getAll();
        System.out.println("服务端接收到的上下文:"+ctx);
        return new Order(id, "Cuijing" + System.currentTimeMillis(), 9.9f);
    }
}
